package com.ykg.exception;

import com.ykg.util.ResultResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * TODO
 * 类(接口)：
 * Created on 8:19 2021/6/23.
 *
 * @Author: laobian
 * @Description:异常捕获
 */
public class CommonExceptionHandler {
    @ExceptionHandler(value = CommonException.class)
    @ResponseBody
    public ResultResponse handlerSellException(CommonException e) {
        return new ResultResponse(e.getCode(), e.getMessage());
    }
}
